from rest_framework import serializers

from goods.models import SpecificationOption, SPUSpecification


class SpecSerializer(serializers.ModelSerializer):
    class Meta:
        model = SPUSpecification
        fields = ('id', 'name')

class OptionsSerializer(serializers.ModelSerializer):

    spec = SpecSerializer

    class Meta:
        model = SpecificationOption
        fields = ('id', 'value', 'spec')